﻿/*
 * Copyright 2011 Edward L. Stauff.                           Contact: <EdStauff@gmail.com>.
 * 
 * This file, "XerialException.cs", is part of the "Stauffware.Common.Xml.Xerialization" 
 * library.  "Stauffware.Common.Xml.Xerialization" is free software: you can redistribute 
 * it and/or modify it under the terms of the GNU Lesser Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or (at your option) 
 * any later version.
 * 
 * "Stauffware.Common.Xml.Xerialization" is distributed in the hope that it will be 
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser Public License for more 
 * details.
 * 
 * You should have received a copy of the GNU Lesser Public License along with 
 * "Stauffware.Common.Xml.Xerialization".  If not, see <http://www.gnu.org/licenses/>.
 */
using System;
using System.Collections.Generic;
using System.Text;
using Stauffware.Common.Core;

namespace Stauffware.Common.Xml.Xerialization
{
	/// <summary>
	/// Indicates a misuse of the Xerialization library; that is, a programming
	/// error by the user of the library.
	/// </summary>
	public class XerialException : Assertion
	{
		/// <summary>
		/// Constructor
		/// </summary>
		public XerialException (string descr)
			: base(descr + " (this is most likely a misuse of the Xerialization library)")
		{
		}

		/// <summary>
		/// Constructor
		/// </summary>
		public XerialException (NiceXmlReader reader, string descr)
			: base(descr + " (line " + reader.LineNumber.ToString() + ", pos " + reader.LinePosition +
					") - this is most likely a misuse of the Xerialization library")
		{
		}
	}
}
